<template>
	<view class="data_icon">
		<image v-if="src =='WORD'" class="size" src="../static/images/WORD.png" />
		<image v-if="src == 'ECEL'" class="size" src="../static/images/ECEL.png" />
		<image v-if="src == 'CSV'" class="size" src="../static/images/CSV.png" />
		<image v-if="src == 'PPT'" class="size" src="../static/images/PPT.png" />
		<image v-if="src == 'PDF'" class="size" src="../static/images/PDF.png" />
		<image v-if="src == 'ZIP'" class="size" src="../static/images/ZIP.png" />
	</view>
</template>
<script setup>
	import {
		defineProps,
		computed,
		ref
	} from 'vue';
	const props = defineProps({
		format: {
			type: String,
			default: 'other',
			required: true
		},
		size: Number
	})
	const src = computed(() => {
		if (props.format.indexOf('doc') > -1) {
			return "WORD"
		}
		if (props.format.indexOf('xls') > -1) {
			return "ECEL"
		}
		if (props.format.indexOf('csv') > -1) {
			return "CSV"
		}
		if (props.format.indexOf('ppt') > -1) {
			return "PPT"
		}
		if (props.format.indexOf('pdf') > -1) {
			return "PDF"
		}
		if (props.format.indexOf('rar') > -1 || props.format.indexOf('zip') > -1) {
			return "ZIP"
		}
		return "WORD"
	})
</script>

<style lang="scss">
	.size {
		width: 50px;
		height: 50px;
	}
</style>